package com.blog.study.study8;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.Transaction;

/**
 * 〈有关Redis的事务处理〉<br>
 *
 * @author 未绪
 * @time 2017/12/12 20:10
 */
public class JedisTransDemo {
    public static final String HOST="192.168.88.129";
    public static final int PORT=6380;

    public static void main(String[] args) {

        Jedis jedis=new Jedis(HOST,PORT);
        Transaction transaction=jedis.multi();
        transaction.set("zw","Chinese");
        transaction.set("ym","English");
        transaction.exec();//执行事务
//        transaction.discard();//取消事务

    }
}
